//
//  Stack.h
//  algorithmDemo
//
//  Created by 李文深 on 16/8/21.
//  Copyright © 2016年 30pay. All rights reserved.
//

#ifndef Stack_h
#define Stack_h

#include <stdio.h>
#include "Const.h"

typedef char ElementType;

typedef struct Stack{
    ElementType data;
    struct Stack *top;
    struct Stack *base;
    int size;
} Stack;

typedef Stack* pStack;

pStack initStack();

void push(pStack s ,ElementType e);

int pop(pStack s ,ElementType *e);

int size(pStack s);

int isEmpty(pStack s);

//读取一行字符串
int my_getline(char* line, int max_size);

/**
 *  判断一个字符串是否符合括号匹配原则
 *
 *  @param s   栈
 *  @param str 要判断的字符串
 *
 *  @return 成功返回1 失败返回0
 */
int parse(pStack s,char *str);


#endif /* Stack_h */
